<%@ page contentType="text/html; charset=utf-8" language="java"  errorPage="" %>

<%@page import="com.bban.util.StringUtil"%>
<%@page import="com.bban.util.cfg.DBCfg"%>
<%@page import="com.bban.dto.vo.*"%>
<%@page import="com.bban.db.dao.*"%>
<%@page import="com.bban.bo.*"%>
<%@page import="com.bban.entry.UserCenter2"%>
<%@page import="com.bban.bo.GPSMgr"%>

<%
request.setCharacterEncoding("utf-8");
String command = request.getParameter("command");
if(!StringUtil.isNullOrEmpty(command) && command.equals("logout")){
	session.invalidate();
	response.sendRedirect("/");
	return;
}


String userName = request.getParameter("userName");
EbabyUser bUser = new EbabyUser();

if(!StringUtil.isNullOrEmpty(userName)){
	
	String pwd = request.getParameter("pwd");
	if(StringUtil.isNullOrEmpty(pwd)){
		out.print("密码不能为空！");
		return;
	}
	
	
	User user = new User();
	UserVO vo = user.login(userName, pwd);
	
	if(vo == null){
			out.print("用户名（"+userName+"）或密码错误");
		return;
	}else{
	
	session = request.getSession(true);
	session.setAttribute("eBabyID", vo.getUSER_ID() + "");
	session.setAttribute("userVO", vo);
		
//	long ePlayerID = bUser.getPlayerIDbyUserID(vo.getUSER_ID());
//	session.setAttribute("ePlayerID", ePlayerID+"");
				
	response.sendRedirect("index1.jsp");
	return;
	}	
}
	
//得到速度最快的tracker
GPSMgr mgr = new GPSMgr();
GPSVO gpsvo = mgr.getLoginInterfaceSimID();
if(gpsvo == null){
	gpsvo = new GPSVO();
	//gpsvo.setSIMID("13968019262");
	gpsvo.setUSER_ID(55);
}
gpsvo.setUSER_ID(1637);

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>谷米科技-索米克手机服务平台</title>

<script type="text/javascript" src="js/key.js"></script>
<script type="text/javascript">
//<![CDATA[
           loadGoogleJS();
//window.onload = function(){loadGoogleJS()};
//]]>
</script> 

<script type="text/javascript" src="js/public.js"></script>

            <script src="js/maps.js"  type="text/javascript"></script>
                <script type="text/javascript" src="js/gmaps/popupmarker.js"></script>
                <script type="text/javascript" src="js/myjsframe.js"></script>
                <script type="text/javascript" src="js/maps.js"></script>
                <script type="text/javascript" src="js/mm.js" ></script>
  <script type="text/javascript">
    //<![CDATA[
    
    var len = 0;
    
    function load() {
        
      if (GBrowserIsCompatible()) {
 
    	  
       setUserID(<%=gpsvo.getUSER_ID()%>);
	   //setUserID("115");
       setPage("index");
       //alert("sss");
    	  getpoint();    	  
    	  
    	  intervalID = window.setInterval( function() {

    	  		if (runCount == 30) {
    	  			window.clearInterval(intervalID);
    	  			runCount = 0;
    	  			return;
    	  		}
    	  		getpoint();
    	  	}, 10000);
      }
    }   
    //]]>
    </script>


</head>
<link rel="stylesheet" href="images/style.css" />
<body onLoad="load()" onUnload="GUnload()">
<div id="head">
	<div class="head_left"></div>
</div>
<div id="main">
	<div class="left">
		<div class="left_column">
			<div id="login">
				<div class="top">
					<img src="images/login_top.gif" />
				</div>
				<div class="middle">
                  <form id="loginform" name="loginform" method="post" action="">
                    <ul>
                      <li>
                        <p><img src="images/yhm.jpg" /></p>
                        <input name="userName" type="text" class="intext" value="GW12347"/>
                      </li>
                      <li>
                        <p><img src="images/pass.jpg" /></p>
                        <input name="pwd" type="password" class="intext" value="123456"/>
                      </li>
                      <li>
                        <input name="image" type="image" class="btn" src="images/login.gif" />
                      </li>
                    </ul>
                  </form>
			  </div>
				<div class="bottom">
					欢迎进入索米克手机服务平台
				</div>
			</div>
			<div class="left_banner">
				<img src="images/left_banner1.jpg" class="img_style1" />
			</div>
			<div class="left_banner">
				<img src="images/left_banner2.jpg" class="img_style1" />
			</div>
		</div>
	</div>
	<div class="right">
		<div class="banner">
			<img src="images/banner.jpg" />
		</div>
		<div class="right_cloumn">
			<div class="map">
				<div class="map_title">
					<h4 class="style1">地图</h4>
				</div>
				
				<div id="map" class="map_content">
					
				</div>
			</div>
			<div class="news">
				<div class="news_title">
					<h4 class="style1">最新新闻</h4>
				</div>
				<div class="news_content">
					<ul>
						<li>谷米.索米克 8 月试运行</li>
						<li><a href="http://www.gpsbox.net" target="_blank">谷米.爱车安-----车的掌上社区</a></li>
						<li><a href="http://219.133.105.163/ebaby" target="_blank">谷米.贝贝安---孩子的掌上社区</a></li>
						<li><a href="http://www.coomix.net" target="_blank">谷米.酷米克---年轻人的掌上社区</a></li>
						<li><a href="#" target="_blank">谷米.老来福---老人的掌上社区</a></li>
					</ul>
				</div>
			</div>
		</div>
		<div class="main_foot">
			Copyright &copy; 2005-2009 深圳市谷米科技有限公司 版权所有  粤ICP备07501873&nbsp;&nbsp;&nbsp;
		</div>
	</div>
</div>
<div id="foot">
</div>
</body>
</html>
